import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';


@Component({
  selector: 'app-recommend',
  templateUrl: './recommend.component.html',
  styleUrls: ['./recommend.component.scss']
})
export class RecommendComponent implements OnInit {
  // 获取远程商品列表
  public recommendList: any [] = [];

  constructor(public http: HttpClient) { }

  ngOnInit() {
    const url: any = 'http://192.168.2.228:8080/goods/list';
    this.http.get(url).subscribe((Response: any) => {
      this.recommendList = Response.data.list;
    });

  }

}
